Higher-Order Lucid∗
نویسنده
چکیده
In this paper we remedy one of the most annoying weaknesses of Lucid and indexical languages in general: the lack of higher-order functions. We describe a simple generalization of the “place-code” approach (as discovered by Ostrum and formalized by Yaghi) which handles programs with functions of arbitrarily high orders; in other words, typed Iswim. A source program P with function definitions (including recursive ones) is translated into a 0-order program P ′ (one with no user-defined functions) with extra indexical operators for manipulating place codes. The only difference between the first-order and the general case is that in the general case we need more than one dimension of place codes. In fact, the number of dimensions is exactly the order of the program. The translated program P ′ can be implemented by eduction—tagged, demand-driven dataflow. The use of place codes causes no real complications: they are treated as just another field in the tag, along with the time and space tags. Naturally, the technique works even in the simple case that the original program has no indexical operators—is pure Iswim. In this case the technique gives us a promising new dataflow approach to implementing the typed lambda calculus. 1 The Need for Higher-Order Dataflow Indexical programmers have long felt that the lack of higher-order functions was one of Lucid’s greatest weaknesses—a weakness shared by all the indexical languages and, more generally, by most dataflow languages. This weakness was discussed in the Lucid Book where, for example, it was pointed out that we have to write comp(P ) = optimize(code(parse(lex (P )))) We cannot simply write lex | parse | code | optimize even though the latter reveals much better the dataflow structure (a simple pipeline) of the expression. The problem is that reverse function composition (the | operator) is second order—its arguments are (first-order) functions. A more serious instance of the problem arises in numerical analysis, one of the preferred application areas for dataflow. Many numerical algorithms (such as integration) naturally have a parameter which is a function (such as the function to be integrated). We cannot write a single Lucid function which performs integrations; instead we need a set of cloned function definitions, one for every particular function which needs (say) integrating. The problem is not really semantics: since the collection of Lucid streams forms a domain, we can in turn form domains of arbitrarily high-order functions over streams. There are some subtle ∗Presented to the 4th International Symposium on Lucid and Intensional Programming, SRI International, Menlo Park, Carlifornia, USA, 29–30 April 1991.
منابع مشابه
Formally Specifying and Proving Operational Aspects of Forensic Lucid in Isabelle
A Forensic Lucid intensional programming language has been proposed for intensional cyberforensic analysis. In large part, the language is based on various predecessor and codecessor Lucid dialects bound by the higher-order intensional logic (HOIL) that is behind them. This work formally specifies the operational aspects of the Forensic Lucid language and compiles a theory of its constructs usi...
متن کاملEncoding Forensic Multimedia Evidence from MARF Applications as Forensic Lucid Expressions
In this work we summarize biometric evidence as well as file type evidence extraction “exported” as formal Forensic Lucid language expression in the form of higher-order intensional contexts for further case analysis by a system that interprets Forensic Lucid expressions for claim verification and event reconstruction. The digital evidence is exported from the Modular Audio Recognition Framewor...
متن کاملMetacognitive mechanisms underlying lucid dreaming.
Lucid dreaming is a state of awareness that one is dreaming, without leaving the sleep state. Dream reports show that self-reflection and volitional control are more pronounced in lucid compared with nonlucid dreams. Mostly on these grounds, lucid dreaming has been associated with metacognition. However, the link to lucid dreaming at the neural level has not yet been explored. We sought for rel...
متن کاملMonads and Intensionality∗
Monads are a concept of category theory which can be used to structure functional programs or even define nonstandard interpretations of the λ-calculus. These nonstandard functional languages share many of Lucid’s unusual features, such as the distinction between synchronic and general functions. In fact Lucid is exactly one of these languages, determined by a simple stream monad. We therefore ...
متن کاملApplications of Lucid Dreaming in Sports
The following article has above all a practical orientation. The various possibilities for the application of lucid dreaming in sports training are presented and briefly illustrated. These theses are based on findings from experiments with experienced lucid dreamers who were instructed to carry out various routine and sport-related actions while lucid-dreaming, with the object of observing the ...
متن کامل